home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 120
/
120.d81
/
chile chal
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
7KB
|
288 lines
10 poke52,56:poke51,0:poke56,56:poke55,0:clr
20 dv=peek(186):ifdv<8thendv=8
30 poke53281,0:poke53280,0
40 print"[147]":poke53272,23:gosub2050
50 dimgr(13,4),gx(13,4),gy(13,4),x(13),y(13),n(18)
60 sys57812"chile font",dv,0:poke780,0:poke781,0:poke782,56:sys65493
70 sys57812"wnd/inp/cm/ind",dv,0:poke780,0:poke781,0:poke782,192:sys65493
72 sys57812"chile sfx",dv,0:poke780,0:poke781,0:poke782,201:sys65493
76 sd=201*256:sys sd:syssd+12
80 poke53265,11:poke53272,31
90 up=49152 :rem scroll up
100 dn=up+3 :rem scroll down
110 cm=50432 :rem copymem
120 goto360
127 :
128 :rem store screen
129 :
130 sys cm,1024,20480+bu*2000,1000
140 sys cm,55296,21480+bu*2000,1000
150 return
157 :
158 :rem restore screen
159 :
160 sys cm,20480+bu*2000,1024,1000
170 sys cm,21480+bu*2000,55296,1000
180 return
187 :
188 :rem move chile routine
189 :
190 poke214,gy(x(c),y(c)):print:printtab(gx(x(c),y(c)))cg$
200 poke214,hq:print:printtab(j*3+hd)ch$"[145][157][157]"chr$(c+192)
202 syssd+9,sq
210 gr(j,k)=gr(x(c),y(c)):gr(x(c),y(c))=0:x(c)=j:y(c)=k
220 return
227 :
228 :rem print ms$
229 :
230 poke781,24:sys59903
240 poke214,23:print"[155]":printtab(20-len(ms$)/2)ms$""
250 return
257 :
258 :rem wiggle scales
259 :
260 syssd+9,2:fori=0to2
270 sysdn,1,4,18,6,0
280 sysup,21,3,18,6,0:poke214,7:print:printtab(28)mt$
290 sysup,1,4,18,6,0
300 sysdn,21,3,18,6,0:poke214,8:print:printtab(8)mt$
310 sysup,1,3,18,6,0
320 sysdn,21,4,18,6,0:poke214,7:print:printtab(8)mt$
330 sysdn,1,3,18,6,0
340 sysup,21,4,18,6,0:poke214,8:print:printtab(28)mt$
350 next:return
357 :
358 :rem setup
359 :
360 bg$="@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
370 ch$=" [149][160][157][157][161] [162][157][157][157][163] [164][157][157][157][165][166][167]"
380 cg$=" [157][157][157] [157][157][157] [157][157][157] "
390 ci$=" [160][157][157][161] [162][157][157][157][163] [164][157][157][157][165][166][167]"
400 pl$="[158]#$ %&"
410 mt$="[155]_[152]__[151]_"
420 nu$="[152][172][198]2[146][187][157][157][157][157]____[157][157][157][157][188]__[190]"
430 nu$(1)="[152]:;[157][157]<=":nu$(2)="[152][180][181][157][157][182][183]":nu$(3)="[152][184][185][157][157][186][187]"
440 i=rnd(-ti)
450 v(0)=-.1:v(1)=.1:v$(0)="[204]ight":v$(1)="[200]eavy"
460 fori=0to2:forj=0to11:readgx(j,i),gy(j,i):next:next
470 data1,3,4,3,7,3,10,3,13,3,16,3,21,3,24,3,27,3,30,3,33,3,36,3
480 data1,14,4,14,7,14,10,14,13,14,16,14,20,14,23,14,26,14,30,14,33,14,36,14
490 data1,18,4,18,7,18,10,18,13,18,16,18,20,18,23,18,26,18,30,18,33,18,36,18
500 gosub1650
507 :
508 :rem game screen
509 :
510 poke53265,11:print"[147] [176][174][176][174][174][174][176][176][174][176][174][176][174][176]\[176][174]
520 [153]" (NULL)-<(NULL)-<(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)/^printchilechallenge"
530 [153]" /expexp//expexp//exp/expexp/exp/exp
540 poke214,7:print:print""pl$""pl$
550 fori=1to3
560 printtab(8)mt$tab(28)mt$
570 next
580 printtab(9)"[145][152][198]1"tab(29)"[198]3"
590 printtab(8)"[155][188][152]__[151]_[152]________________[155]_[152]__[151][190]"
600 printtab(18)"[145][145]"nu$
610 poke214,13:print:printtab(19)"[145][145]"nu$(1)
620 print"[149][176][192][192][192][192][192][192][179][155][211][208][193][195][197][149][171][192][192][192][192][192][178][192][192][192][179][155][198]5[149][171][192][192][178][192][192][192][179][155][198]7[149][171][192][192][174]";
630 fori=1to8:print"[221] [221] [221] [221]";:next
640 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][189]";
650 fori=217to242:pokei,peek(i)or128:next
660 fori=1to6:poke214,14:print:printtab(i*3-2)ch$;:print"[145][157][157]"chr$(192+i)
670 poke214,18:print:printtab(i*3-2)ch$;:print"[145][157][157]"chr$(198+i):next
680 poke53265,27
687 :
688 :rem setup arrays/variables
689 :
690 fori=0to2:forj=0to11:gr(j,i)=0:next:next
700 fori=1to2:forj=0to5:gr(j,i)=1:next:next
710 fori=1to6:x(i)=i-1:y(i)=1:x(i+6)=i-1:y(i+6)=2:next
720 u=int(rnd(0)*12):uu=int(rnd(0)*2)
730 ifu>5thengr(u-6,2)=1+v(uu):goto750
740 gr(u,1)=1+v(uu)
750 w=1:ww=0:n=0
760 print""
762 ms$="[193] to [204] [198]-keys/[211][208][193][195][197] [205] - [205]enu":gosub230
767 :
768 :rem main loop
769 :
770 geta$:ifa$=""then770
780 ifa$="[137]"then1330
790 ifa$<>"m"then800
792 bu=2:gosub130:gosub1650:bu=2:gosub160
794 ifww=1anda$="2"then510
796 goto770
800 ifa$<"a"ora$>"l"then770
810 n=1
820 c=asc(a$)-64:n(n)=c
830 poke214,gy(x(c),y(c)):print:printtab(gx(x(c),y(c)))""ci$"[145][157][157]"chr$(192+c)
840 poke214,gy(x(c),y(c)):print:printtab(gx(x(c),y(c)))ch$"[145][157][157]"chr$(192+c)
850 geta$:ifa$=""then830
860 ifa$>="[133]"anda$<="[137]"then940
870 ifn=1anda$=" "then1260
880 ifa$=" "then940
890 ifa$<"a"ora$>"l"then830
900 poke214,gy(x(c),y(c)):print
910 printtab(gx(x(c),y(c)))""ci$"[145][157][157]"chr$(192+c)
920 n=n+1
930 goto820
940 ww=1:fori=0to11:ifn(i)=0then960
950 c=n(i):n(i)=0:i=11
960 next:n=n-1
970 ifn<0then770
980 ifa$=" "then1260
990 onasc(a$)-132goto1000,1060,1120,1190,1620
997 :
998 :rem f1
999 :
1000 j=6:fori=0to5:ifgr(i,0)=0thenj=i:i=5
1010 next:k=0
1020 ifj=6then770
1030 sq=0:hq=3:hd=1:gosub190
1040 ifnthen940
1050 goto770
1057 :
1058 :rem f3
1059 :
1060 j=12:fori=6to11:ifgr(i,0)=0thenj=i:i=11
1070 next:k=0
1080 ifj=12then770
1090 sq=0:hq=3:hd=3:gosub190
1100 ifnthen940
1110 goto770
1117 :
1118 :rem f5
1119 :
1120 j=0:fori=6to8:ifgr(i,1)=0thenj=i:i=8:k=1
1130 next:ifjthen1160
1140 fori=6to8:ifgr(i,2)=0thenj=i:i=8:k=2
1150 next:ifj=0then770
1160 sq=1:hq=gy(0,k):hd=2:gosub190
1170 ifnthen940
1180 goto770
1187 :
1188 :rem f7
1189 :
1190 j=0:fori=9to11:ifgr(i,1)=0thenj=i:i=11:k=1
1200 next:ifjthen1230
1210 fori=9to11:ifgr(i,2)=0thenj=i:i=11:k=2
1220 next:ifj=0then770
1230 sq=1:hq=gy(0,k):hd=3:gosub190
1240 ifnthen940
1250 goto770
1257 :
1258 :rem space
1259 :
1260 j=6:fori=0to5:ifgr(i,1)=0thenj=i:i=5:k=1
1270 next:ifj<6then1300
1280 fori=0to5:ifgr(i,2)=0thenj=i:i=5:k=2
1290 next:ifj=6then770
1300 sq=1:hq=gy(0,k):hd=1:gosub190
1310 ifnthen940
1320 goto770
1327 :
1328 :rem weighing
1329 :
1330 bu=1:gosub130
1340 w1=0:fori=0to5:w1=w1+gr(i,0):next
1350 w2=0:fori=6to11:w2=w2+gr(i,0):next
1360 ifw2=w1thengosub260:goto1450
1370 ifw2>w1then1420
1380 gosub260:sysdn,1,4,18,6,0
1390 sysup,21,3,18,6,0
1400 poke214,7:print:printtab(28)mt$
1410 goto1450
1420 gosub260:sysup,1,3,18,6,0
1430 sysdn,21,4,18,6,0
1440 poke214,7:print:printtab(8)mt$
1450 w=w+1:ifw>3then1500
1470 geta$:ifa$=""then1470
1480 bu=1:gosub160
1482 poke214,11:print:printtab(19)nu$(w)
1490 goto790
1497 :
1498 :rem well?
1499 :
1500 ms$="[211]o, which is the oddball?":gosub230
1510 geta$:ifa$<"a"ora$>"l"then1510
1520 ms$="[193]nd is it light or heavy? (l/h)":gosub230
1530 getb$:ifb$<>"l"andb$<>"h"then1530
1540 ifu<>asc(a$)-65then1600
1550 ifuu=0andb$="h"then1600
1560 ifuu=1andb$="l"then1600
1570 ms$=" [217]ou did it!!! [212]hat's right!":gosub230
1572 forj=0to2:fori=0to15:syssd+9,iand3:next:next
1580 geta$:ifa$=""then1580
1590 goto1620
1600 ms$="[212]hat's not it. [201]t's "+chr$(u+193)+" - "+v$(uu):gosub230
1610 geta$:ifa$=""then1610
1620 ww=0:gosub1650
1630 goto510
1647 :
1648 :rem menu
1649 :
1650 bu=0:iff1thengosub160:goto1890
1660 f1=1:poke53265,11
1670 print"[147][154]";:
1680 fori=0to23:printbg$;:next
1690 printleft$(bg$,39)"[157][148]@"
1700 print""left$(bg$,34)
1710 fori=217to242:pokei,peek(i)or128:next
1720 print"[158][[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]\"
1730 fori=0to17:print"[158][165] [167]@":next
1740 print"[158]][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]^@"
1750 print""left$(bg$,36)
1760 print"[176][174][176][174][174][174][176][176][174][176][174][176][174][176]\[176][174][146] [153]chile
1770 [153]"(NULL)-<(NULL)-<(NULL)(NULL)(NULL)(NULL)(NULL)